<?php
/**          
**/

session_start();
include('../include/config.inc.php');
include(CE_ROOT.'/include/celive.class.php');
$login = new celive();
$login->auth();
$login->template();

if (isset($_POST['username']) && isset($_POST['password'])) {
    $GLOBALS['auth']->login(addslashes($_POST['username']), addslashes($_POST['password']));
}
if ($GLOBALS['auth']->check_login()) {
    header('Location: '.CE_ROOT.'/admin/index.php');
} else {
    if (isset($_POST['username']) && isset($_POST['password'])) {
        $GLOBALS['template']->assign('login_text', $GLOBALS['lang']['login_failure']);
    }
    $GLOBALS['template']->assign('action','login.php');
    $GLOBALS['template']->display('admin/login.htm');
}
?>